package cn.com.dycc.party_org.membership.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import cn.com.dycc.party_org.membership.entity.MemberShipEntity;
import cn.com.dycc.party_org.membership.param.AddMemberShipParam;

@Repository("memberShipDao")
public interface MemberShipDao {
	
	/**
	 * 增加党籍信息
	 * @param addMemberShipParam
	 * @return
	 */
	public int addMemberShip(AddMemberShipParam addMemberShipParam);
	
	/**
	 * 根据id删除党籍信息
	 * @param info_id
	 * @return
	 */
	public int delMemberShipByInfoId(
			@Param("info_id")String info_id,
			@Param("org_id")String org_id);
	
	/**
	 * 查询该党员用户的所有党籍变化信息
	 * @param user_id
	 * @param org_id
	 * @return
	 */
	public List<MemberShipEntity> findMemberShipList(
			@Param("user_id")String user_id,
			@Param("org_id")String org_id);
	
	/**
	 * 根据user_id和党籍类型统计是否已经存在
	 * @param user_id
	 * @param party_type
	 * @return
	 */
	public int findCountByUserIdAndPartyType(
			@Param("user_id")String user_id,
			@Param("party_type")String party_type,
			@Param("org_id")String org_id);
}
